/*
 * Copyright 2025 The JA-SIG Collaborative. All rights reserved.
 * distributed with this file and available online at
 */
package com.lap.auth.domain.api;

import com.lap.framework.common.ddd.AggregateRoot;
import lombok.Getter;

/**
 * API接口领域。
 *
 * @author Shuisheng Lao(劳水生)
 * @version 0.0.1
 */
@Getter
public class Api extends AggregateRoot {

  private final Integer id;
  private final String module;
  private final String parentCode;
  private final String code;
  private final String name;
  private final String method;
  private final String uri;
  private final Integer apiType;
  private final Integer accessLevel;
  private final Integer viewType;
  private final Integer updatedFlag;

  public Api(
      Integer id,
      String module,
      String parentCode,
      String code,
      String name,
      String method,
      String uri,
      Integer apiType,
      Integer accessLevel,
      Integer viewType,
      Integer updatedFlag) {
    this.id = id;
    this.module = module;
    this.parentCode = parentCode;
    this.code = code;
    this.name = name;
    this.method = method;
    this.uri = uri;
    this.apiType = apiType;
    this.accessLevel = accessLevel;
    this.viewType = viewType;
    this.updatedFlag = updatedFlag;
  }

  public boolean isNew() {
    return (id == null);
  }
}
